import { server } from "@/request";
import service from "@/utils/request";
// ts类型
import type { IRes } from "./api";
export interface ILogin {
  token: string;
}
export interface IUserInfo {
  name: string;
  avatar: string;
  buttons: string[];
  roles: string[];
  routes: string[];
}
//api
// 获取token
export const reqToken = (username: string, password: string) => {
  return server.post<any, IRes<ILogin>>("/acl/index/login", {
    username,
    password,
  });
};
//获取userInfo
export const reqUserInfo = () => {
  // const userStore = setUserStore(pinia)
  return server.get<any, IRes<IUserInfo>>("acl/index/info");
};
//退出
export const reqLogout = () => {
  return server.post<any, any>("/acl/index/logout");
};
